<%@page import="entities.MetaSeo"%>
<%@page import="helpers.StringHelper"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.TreeMap"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.ArrayList"%>
<%
TreeMap<String, String> check = (TreeMap<String, String>) request.getAttribute("check");
TreeMap values = (TreeMap) request.getAttribute("values");
String success = (String) request.getAttribute("success");
MetaSeo metaseo = (MetaSeo) request.getAttribute("metaseo");

//Set content for Seo
Map<String, String> replates = new TreeMap<String, String>();
replates.put("__SERVER_NAME__", UrlHelper.getDomainServer(request));
replates.put("__SERVER_URL__", UrlHelper.getServerUrl(request));


String title = StringHelper.replateContent(metaseo.getTitle(), replates);
String description = StringHelper.replateContent(metaseo.getDescription(), replates);
String keywords = StringHelper.replateContent(metaseo.getKeywords(), replates);
String url = StringHelper.replateContent(metaseo.getOgurl(), replates);
%>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/templates/default/layouts/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
    <jsp:param name="description" value="<%=description %>" />
    <jsp:param name="keywords" value="<%=keywords %>" />
    <jsp:param name="ogtitle" value="<%=title %>" />
    <jsp:param name="ogurl" value="<%=url %>" />
    <jsp:param name="ogdescription" value="<%=description%>" />
</jsp:include>

		<div class="row-fluid clearfix">
			<!-- Main Content -->
			<div class="span9 main-content domain-info">
				
				
				<section class="staticpage">
					<div class="block">
						<div class="block-content no-bg">
							<h4>Contact Us</h4>
							
							<% if (success != null) { %>
							<div class="alert alert-success">
								<button type="button" class="close" data-dismiss="alert">&times;</button>
							  	<%=success %>
							</div>
							<% } %>
							<p>We would love to hear from you, please use the contact form below to send us an email or alternatively contact us on one of the other methods below:</p>
							
							<form method="post">
								<div class="row-fluid">
									<div class="span6">
											<div class="control-group <%=check.get("name") != null ? "error" : "" %>">
											<label>Your name</label>
						                    <input type="text" placeholder="" class="span11" name="name" data-original-title="" value="<%=values.get("name") != null ? values.get("name") : "" %>">
						                    <% if (check.get("name") != null ) { %>
						                    <span class="help-inline"><%=check.get("name") %></span>
						                    <% } %>
					                    </div>
					                    
					                    <div class="control-group <%=check.get("email") != null ? "error" : "" %>">
						                    <label>Your email address</label>
						                    <input type="text" placeholder="" class="span11 email" name="email" value="<%=values.get("email") != null ? values.get("email") : "" %>" data-original-title="">
						                    <% if (check.get("email") != null ) { %>
						                    <span class="help-inline"><%=check.get("email") %></span>
						                    <% } %>
					                    </div>
					                    
					                    <div class="control-group <%=check.get("captcha") != null ? "error" : "" %>">
			                                <script>
									        	var RecaptchaOptions = { theme : 'white'};
									  		</script>
											<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LeA0c4SAAAAAMsdjrB49GPol6XImTdJM2U2AHrF"></script>
											<% if (check.get("captcha") != null ) { %>
						                    <span class="help-inline"><%=check.get("captcha") %></span>
						                    <% } %>
										</div>
					                    <div class="">
					                        <button class="btn btn-primary" type="submit">Send your message</button>
					                    </div>
									</div>
									<div class="span6">
										<div class="control-group <%=check.get("title") != null ? "error" : "" %>">
											<label>Message Title</label>
						                    <input type="text" placeholder="" class="span11" name="title" value="<%=values.get("title") != null ? values.get("title") : "" %>" data-original-title="">
						                    <% if (check.get("title") != null ) { %>
						                    <span class="help-inline"><%=check.get("title") %></span>
						                    <% } %>
						                </div>
					                    
					                    <div class="control-group <%=check.get("content") != null ? "error" : "" %>">
											<label>Message Content</label>
						                    <textarea placeholder="" rows="7" name="content" class="span12" data-original-title=""><%=values.get("content") != null ? values.get("content") : "" %></textarea>
						                    <% if (check.get("content") != null ) { %>
						                    <span class="help-inline"><%=check.get("content") %></span>
						                    <% } %>
						                </div>
									</div>
								</div>
							</form>
						</div>
					</div>
				</section>
				
			</div>
			<!-- Main Content -->
			
			<!-- slidebar BEGIN -->
			<jsp:include page="/templates/default/elements/right.jsp" />
			<!-- slidebar END -->
		</div>

<jsp:include page="/templates/default/layouts/footer.jsp" />